package com.bishe.demo.modules.hotel.hotelRoom.dao;

import com.bishe.demo.modules.hotel.hotelRoom.entity.RoomHotelImage;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface RoomHotelImageDao {
    @Insert("insert into hotel_room_hotel_image values(null,#{roomId},#{hotelImageId})")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    void insertRoomHotelImage(RoomHotelImage roomHotelImage);

    @Delete("delete from hotel_room_hotel_image where hotel_image_id=#{imageId}")
    void deleteRoomImageByImageId(int imageId);

    @Delete("delete from hotel_room_hotel_image where room_id=#{roomId}")
    void deleteRoomImageByRoomId(int roomId);
}
